# demo05_module.py
# vim /opt/benben.py
# def func01():
#     print("benben's py")
import benben
import sys
benben.func01()  # 模块.函数   类似于   random.randint()
# [root@localhost day08]# python3 demo05_module.py
# Traceback (most recent call last):
#   File "demo05_module.py", line 7, in <module>
#     import benben
# ModuleNotFoundError: No module named 'benben'  # 导入失败
# 临时修改: 通过导入环境变量的方式将/opt目录放到模块搜索区域
# [root@localhost day08]# export PYTHONPATH=/opt
# [root@localhost day08]# python3 demo05_module.py
# benben's py  # 导入成功，执行函数



print(sys.path)
# ['/root/PycharmProjects/NSD2202/day08',
# '/root/PycharmProjects/NSD2202',
# '/root/3/pycharm/pycharm-2020.1.1/plugins/python/helpers/pycharm_display',
# '/usr/lib64/python36.zip',
# '/usr/lib64/python3.6',
# '/usr/lib64/python3.6/lib-dynload',
# '/usr/lib64/python3.6/site-packages',
# '/usr/lib/python3.6/site-packages',
# '/root/3/pycharm/pycharm-2020.1.1/plugins/python/helpers/pycharm_matplotlib_backend']

